An Example Message Format

The following is a typical message format that displays the most relevant information about a warning message:

%W(80)%i( )%?C%(%^%)%f(%l) ++ %?h%(ERROR%:WARNING%) ++: <=%g=(%n) %t

The components of this string are:

%W(80)

Message text wraps after the last word before column 80.

%i( )

Each hanging indent is indented by three columns.

%?C%(%^%)

A caret is displayed if the location of the error is different from that of the previous error.

%f(%l) ++

The file name and line number (in brackets) is displayed, followed by ’++’.

%?h%(ERROR%: WARNING%) ++:

If the message is a hard error, ERROR is displayed. Otherwise, WARNING is displayed, followed by ’++:’.

<=%g=(%n)

The message level is displayed (preceded by ’<=’). This is followed by the message number (preceded by ’=’).

%t

The message text is displayed.

A warning message with the above format would look like:

int i;
    ^
test.c (1) ++ WARNING ++: <=2=(3408) 'i' has external linkage and is being defined without any previous declaration.